﻿ /*************************************************************************
File:   config.as
Author: Duykham
Date:   19/10/2006
TODO:   Define Constants in CFG_object for BKSCT.fla
/*************************************************************************/
_inc_config_as_ = 1;
trace ("#included: as/config_receiv.as");
///////////////////////////////////////////////////////////////////////////
//TODO:ExternalInterface
import mx.utils.Delegate;
import com.actionscript.configuration.ConfigScript;
//Global Config var
var CFG : Object = new Object ();

this.onDataParsedHandler = function (o : Object) : Void 
{
	var myConfig : ConfigScript = o.target;
	CFG.fmsApp = myConfig.getItemValue ("CFG.fmsApp");
	CFG.fmsDir = myConfig.getItemValue("CFG.fmsDir");
	CFG.webAdd = myConfig.getItemValue("CFG.webAdd");
	CFG.rfidAdd = myConfig.getItemValue("CFG.rfidAdd");
	//CFG.loginUser = myConfig.getItemValue ("CFG.loginUser");
	//CFG.loginPass = myConfig.getItemValue ("CFG.loginPass");
	CFG.soundFile = myConfig.getItemValue ("CFG.soundFile");
	CFG.showInfo = myConfig.getItemValue ("CFG.showInfo");
	CFG.infoString = "<b>FMS Application:</b> " + CFG.fmsApp + "<br/>" + "<b>FMS Directory:</b> " + CFG.fmsDir + "<br/>" + "<b>Web Address:</b> " + CFG.webAdd + "<br/>" + "<b>PHP(RFID) Address:</b> " + CFG.rfidAdd + "<br/>" + "<b>Sound File:</b> " + CFG.soundFile + "<br/>";
}
var cs : ConfigScript = new ConfigScript ();
cs.addEventListener ("Data", Delegate.create (this, this.onDataParsedHandler));
cs.load ("config/receiv.cs");
//Show Info button
info_btn.onRollOver = function()
{
	//trace ("_root.CFG.showInfo: " + _root.CFG.showInfo);
	if (_root.CFG.showInfo == 1)
	{
		trace ("if (_root.CFG.showInfo)");
		//_root.info_txt._visible = true;
		//_root.info_txt.text = _root.CFG.infoString;
		toolTip.show (_root.CFG.infoString, 500, 90, 25, 470);
	}
	else
	{
		//do nothing
	};
};
//Roll out
info_btn.onRollOut = function()
{
		//_root.info_txt._visible = false;
		toolTip.hide();
};